<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>Employee Statistics</title>

    <meta charset="UTF-8">
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

    <script src="https://cdn.bootcdn.net/ajax/libs/bootstrap/5.2.3/js/bootstrap.min.js"></script>
    <link href="https://cdn.bootcdn.net/ajax/libs/bootstrap/5.2.3/css/bootstrap.min.css" rel="stylesheet">

</head>
<body>

<table class="table table-striped table-bordered table-hover">
    <caption>员工信息</caption>
    <thead>
    <tr>
        <th>姓名</th>
        <th>性别</th>
        <th>部门</th>
        <th>职位</th>
    </tr>
    </thead>
    <tbody>
    <tr th:each="row : ${employees}">
        <td th:text="${ row.name }"></td>
        <td th:text="${ row.gender }"></td>
        <td th:text="${ row.department }"></td>
        <td th:text="${ row.jobTitle }"></td>
    </tr>
    </tbody>
</table>


<table class="table table-striped table-bordered table-hover table-dark">
    <caption>按照性别统计</caption>
    <thead>
    <tr>
        <th>性别</th>
        <th>人数</th>
    </tr>
    </thead>
    <tbody>
    <tr th:each="row : ${byGender}">
        <td th:text="${ row.key }"></td>
        <td th:text="${ row.count }"></td>
    </tr>
    </tbody>
</table>


<table class="table table-striped table-bordered table-hover table-dark">
    <caption>按照部门统计</caption>
    <thead>
    <tr>
        <th>部门</th>
        <th>人数</th>
    </tr>
    </thead>
    <tbody>
    <tr th:each="row : ${byDepartment}">
        <td th:text="${ row.key }"></td>
        <td th:text="${ row.count }"></td>
    </tr>
    </tbody>
</table>


<table class="table table-striped table-bordered table-hover table-dark">
    <caption>按照职位统计</caption>
    <thead>
    <tr>
        <th>职位</th>
        <th>人数</th>
    </tr>
    </thead>
    <tbody>
    <tr th:each="row : ${byJobTitle}">
        <td th:text="${ row.key }"></td>
        <td th:text="${ row.count }"></td>
    </tr>
    </tbody>
</table>

</body>
</html>